package com.yehebl.handler.manager;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import com.yehebl.handler.annotaction.NotNull;

public class NotNullManager {
	private  Map<String, Set<String>> map=new HashMap<String, Set<String>>();
	
	/**
	 * 添加参数map
	 * @param key
	 * @param clazzs
	 */
	public  void add(String key,NotNull notNull){
		if(map.containsKey(key)){
			throw new RuntimeException("处理器["+key+"]重复");
		}
		String[] value = notNull.value();
		if(value!=null){
			Set<String> set=new HashSet<String>();
			for (int i = 0; i < value.length; i++) {
				set.add(value[i]);
			}
			map.put(key, set);
		}
		
	}
	
	public  Set<String> get(String key){
		return map.get(key);
	}
}
